import React from 'react'
import {Modal, Table} from 'antd'
import styles from './List.less'

import moment from 'moment';

const dateFormat = 'YYYY-MM-DD HH:mm:ss';

const ExportLogs = ({
  item = {},
  ...modalProps
}) => {
  const columns = [
    {
      title: '#',
      dataIndex: 'index',
      key: 'index',
      width: 40,
      render: (text, record, index) => (index + 1)
    }, {
      title: '导出人姓名',
      dataIndex: 'exportUserName',
      className: styles.userName
    }, {
      title: '导出时间',
      dataIndex: 'exportTime',
      render: (text, record) => moment(text).format(dateFormat)
    }
  ];
  return (
    <Modal {...modalProps}>
      <Table
        pagination={false}
        columns={columns}
        dataSource={item.listLogs.items}
        size="small"
        rowKey={record => record.id}/>
    </Modal>
  )
}

export default ExportLogs

// export default connect(({report, loading}) => ({report,
// loading}))(ExportLogs)